﻿<%@ Page Title="" Language="C#" MasterPageFile="~/StarSecurityServices.Master" AutoEventWireup="true" CodeBehind="frmManagerService.aspx.cs" Inherits="eProject_SEM3_SecurityServices.Presentations.frmService" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Panel ID="pnlNew" runat="server" BackColor="White" ForeColor="#6666FF" 
        GroupingText="New Service">
      <table style="margin-left: 20px; margin-top: 5px; margin-bottom: 10px;">
        <tbody>
            <tr>
                <td>
                    <asp:Label ID="Label1" runat="server" Text="Service Name: "></asp:Label></td>
                <td>
                    <asp:TextBox ID="txtName" runat="server" Width="177px" style="margin-left: 1px"></asp:TextBox></td>
                <td>
                    <asp:RequiredFieldValidator ID="rfvServiceName" runat="server" ErrorMessage="*" 
                        ControlToValidate="txtName" ForeColor="#FF3300" ValidationGroup="0"></asp:RequiredFieldValidator></td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label2" runat="server" Text="Service Description: "></asp:Label></td>
                <td>
                    <asp:TextBox ID="txtServiceDes" runat="server" TextMode="MultiLine"></asp:TextBox></td>
                <td>
                    <asp:RequiredFieldValidator ID="rfvServiceDes" runat="server" ErrorMessage="*" 
                        ControlToValidate="txtServiceDes" ForeColor="#FF3300" ValidationGroup="0"></asp:RequiredFieldValidator></td>
            </tr>
            <tr>
                <td rowspan="2" style="margin-top: 10px">
                    <asp:Button ID="btnAdd" runat="server" Text="Add new service" 
                        ForeColor="#6666FF" onclick="btnAdd_Click" ToolTip="New Service" 
                        ValidationGroup="0" /> 
                    &nbsp 
                    <asp:Button ID="btnCacel" runat="server" Text="Cancel" ForeColor="#6666FF" 
                        ToolTip="Cancel" />
                </td>                
            </tr>
        </tbody>
      </table>
    </asp:Panel>   
    <asp:Panel ID="pnlContent" runat="server" BackColor="White" ForeColor="#6666FF" 
        GroupingText="Service Information">
        <asp:GridView ID="grvServices" runat="server" AutoGenerateColumns="False" 
            BorderStyle="None" BorderWidth="1px" CellPadding="3" Width="539px" 
            ForeColor="#6666FF" AllowPaging="True" DataKeyNames="serviceId" 
            onpageindexchanging="grvServices_PageIndexChanging" ShowFooter="True" 
            onrowcancelingedit="grvServices_RowCancelingEdit" 
            onrowdeleting="grvServices_RowDeleting" 
            onrowediting="grvServices_RowEditing" onrowupdating="grvServices_RowUpdating">
            <Columns>
            <%--ServiceId--%>
                <asp:TemplateField HeaderText="Service ID">
                    <EditItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%#Eval("serviceId") %>'></asp:Label>                        
                    </EditItemTemplate>
                    <ItemTemplate><%#Eval("serviceId") %></ItemTemplate>
                </asp:TemplateField>
            <%--Service Name--%>
                <asp:TemplateField HeaderText="Service Name">                    
                    <EditItemTemplate>
                        <asp:TextBox ID="txtServiceName" runat="server" Text='<%#Bind("serviceName") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate><%#Eval("serviceName") %></ItemTemplate>
                </asp:TemplateField>
            <%--Service Description--%>
                <asp:TemplateField HeaderText="Service Description">
                    <EditItemTemplate>
                        <asp:TextBox ID="txtDes" runat="server" Text='<% #Bind("serviceDescription") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <%#Eval("serviceDescription")%>
                    </ItemTemplate>
                </asp:TemplateField>                
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            </Columns>
            <EmptyDataTemplate>
                <asp:Label ID="Label3" runat="server" Text="Data not found!"></asp:Label>
            </EmptyDataTemplate>
            <FooterStyle BackColor="White" ForeColor="#000066" />
            <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
            <PagerSettings NextPageText="Next" PreviousPageText="Previous" />
            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Center" />
            <RowStyle ForeColor="#000066" />
            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#007DBB" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#00547E" />
        </asp:GridView>
    </asp:Panel>
</asp:Content>

